<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">



    //    1.将A5F3转成2进制
    var num='A5F3';
    var b = parseInt(num,2)
    document.write(b +'<br>' );


    //  2.99乘法表
    for (let index = 1; index <=9; index++) {
        var sum='';
       for (let index1 = 1; index1 <=index; index1++) {
        sum+=index+'x'+index1+'='+index*index1+' ';
       }
       document.write(sum+'<br>');
    }


    // 3.输入年月，（用数组）
    //   3.1.计算当月有多少天
    // 3.2.计算还剩多少天
    var nian=Number(prompt('请输入年份'));
    var yue =Number(prompt('请输入月份'));
    if (yue==1||yue==3||yue==7||yue==9||yue==11){
        alert('31天');
    }else if (yue==2){
        if (nian % 4 == 0 && (nian % 100 != 0)){
            alert('闰年'+"29天");
        }else if (nian % 400 != 0){
            alert('闰年'+"29天");
        }else {
            alert('平年'+"28天");
        }
    }
    else {

        alert("30天");
    }

    </script>
</body>
</html>